﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Devices;
using Devices.Abaxis;

namespace DevicesWPF.UCDevices
{
    /// <summary>
    /// UCFF_6450.xaml 的交互逻辑
    /// </summary>
    public partial class UCAbaxis_VetScan_HM5C : UserControl, IUCConfig
    {
        Abaxis_Fuse info;
        public UCAbaxis_VetScan_HM5C()
        {
            InitializeComponent();
        }
        public UCAbaxis_VetScan_HM5C(Abaxis_Fuse _info)
        {
            InitializeComponent();
            info = _info;
        }

        /// <summary>
        /// 读取配置
        /// </summary>
        /// <param name="hasErrors"></param>
        /// <returns></returns>
        public  Config GetConfig(out int hasErrors)
        {
            hasErrors = 0;
            FuseConfig config = (FuseConfig)info.Config;
            config.CurrentConnectType =ConnectType.HTTP;
            config.Address = textBoxAddress.Text.Trim();
            config.LoginPassword = textBoxPass.Text.Trim();
            config.LoginName = textBoxName.Text.Trim();
            return config;
        }

        private void UCMindray_BC_2800Vet_Load(object sender, RoutedEventArgs e)
        {
            if (this.info == null)
                return;
            FuseConfig config = (FuseConfig)info.Config;
            textBoxAddress.Text = config.Address;// = textBoxAddress.Text.Trim();
            textBoxPass.Text=config.LoginPassword;// = textBoxPass.Text.Trim();
            textBoxName.Text=config.LoginName;// = textBoxName.Text.Trim();
        }
    }
}
